package com.test.dababy.dababy_08_loan_repay;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.test.dababy.R;
import com.test.dababy.dababy_01_launcher.Base_dababyApplication;

import org.json.JSONObject;

public class RpI_dababynf_dababyo {

    private static class Inner {
        private static RpI_dababynf_dababyo instance = new RpI_dababynf_dababyo();
    }

    private RpI_dababynf_dababyo(){}

    public static RpI_dababynf_dababyo getInstance(){
        return Inner.instance;
    }

    public static void parse(JSONObject objJson){
        Inner.instance = new Gson().fromJson(objJson.toString(), RpI_dababynf_dababyo.class);
    }

    private String currency;
    private String days;
    private String repayProFee;
    private String amount;
    private String serviceFee;
    private String serviceVatFee;
    private String overdueDay;
    private String repayAmount;
    private String repayDate;
    private String interest;
    private String overdueAmount;
    private String remainDay;
    public String hje7R ="";
    public String jlT78s ="";
    public String gtgikRe5 ="";
    public String ge0R ="";
    public String gerR ="";
    public String otiRyor8 ="";
    public String ghleEikj045 ="";
    public String hlkRujk45 ="";
    public String hlkjdEth ="";

    public String getCurrency_dababy() {
        if (TextUtils.isEmpty(currency)) return "";
        return currency;
    }

    public String getDays_dababy() {
        if (TextUtils.isEmpty(days)) return "";
        setHje7R(days);
        return days;
    }

    public String getRepayProFee_dababy() {
        if (TextUtils.isEmpty(repayProFee)) return "";
        setHlkjdEth(repayProFee);
        return repayProFee;
    }

    public String getAmount_dababy() {
        if (TextUtils.isEmpty(amount)) return "";
        setGhleEikj045(amount);
        return amount;
    }

    public String getServiceFee_dababy() {
        if (TextUtils.isEmpty(serviceFee)) return "";
        setGe0R(serviceFee);
        return serviceFee;
    }

    public String getServiceVatFee_dababy() {
        if (TextUtils.isEmpty(serviceVatFee)) return "";
        setGerR(serviceFee);
        return serviceVatFee;
    }

    public String getOverdueDay_dababy() {
        if (TextUtils.isEmpty(overdueDay)) return "";

        setGhleEikj045(overdueAmount);

        try {
            int dayInt = Integer.parseInt(overdueDay);
            if (dayInt <= 1) return Base_dababyApplication.getInstant().getString(R.string.day,dayInt);
            else return Base_dababyApplication.getInstant().getString(R.string.days,dayInt);

        }catch (NumberFormatException e){
            e.printStackTrace();
            return Base_dababyApplication.getInstant().getString(R.string.days,0);
        }
    }

    public String getRemainDay() {
        if (TextUtils.isEmpty(remainDay)) return "";

        try {
            int dayInt = Integer.parseInt(remainDay);
            if (dayInt <= 1) return Base_dababyApplication.getInstant().getString(R.string.day,dayInt);
            else return Base_dababyApplication.getInstant().getString(R.string.days,dayInt);

        }catch (NumberFormatException e){
            e.printStackTrace();
            return Base_dababyApplication.getInstant().getString(R.string.days,0);
        }
    }

    public String getRepayAmount_dababy() {
        if (TextUtils.isEmpty(repayAmount)) return "";
        return repayAmount;
    }

    public String getRepayDate_dababy() {
        if (TextUtils.isEmpty(repayDate)) return "";
        return repayDate;
    }

    public String getInterest_dababy() {
        if (TextUtils.isEmpty(interest)) return "";
        return interest;
    }

    public String getOverdueAmount_dababy() {
        if (TextUtils.isEmpty(overdueAmount)) return "";
        return overdueAmount;
    }

    public boolean isOvdu_dababy(){
        try {
            return Integer.parseInt(overdueDay)>0;
        }catch (NumberFormatException e){
            e.printStackTrace();
            return false;
        }
    }

    public void setHje7R(String hje7R) {
        this.hje7R = hje7R;
    }

    public void setJlT78s(String jlT78s) {
        this.jlT78s = jlT78s;
    }

    public void setGtgikRe5(String gtgikRe5) {
        this.gtgikRe5 = gtgikRe5;
    }

    public void setGe0R(String ge0R) {
        this.ge0R = ge0R;
    }

    public void setGerR(String gerR) {
        this.gerR = gerR;
    }

    public void setOtiRyor8(String otiRyor8) {
        this.otiRyor8 = otiRyor8;
    }

    public void setGhleEikj045(String ghleEikj045) {
        this.ghleEikj045 = ghleEikj045;
    }

    public void setHlkRujk45(String hlkRujk45) {
        this.hlkRujk45 = hlkRujk45;
    }

    public void setHlkjdEth(String hlkjdEth) {
        this.hlkjdEth = hlkjdEth;
    }


}
